package com.bdqn.carrental.dao;

import com.bdqn.carrental.pojo.Customers;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

/**
 * 用户表Dao接口
 */
@Repository
public interface CustomersMapper extends
        JpaRepository<Customers,Integer> {
    /**
     * 根据用户名查询客户信息
     * @param name
     * @return
     */
    @Select(" SELECT * FROM customers WHERE IDENTITY=#{identity} AND custpwd=#{custpwd}")
    @ResultType(Customers.class)
    Customers findByIdentityAndCustpwd(@Param("identity") String name,
                             @Param("custpwd") String pwd);


}
